﻿using Sirenix.OdinInspector;

namespace Gp.AI {
    [CreateNodeMenu("条件/位置")]
    public class PositionConditionNode : ConditionNode {
         [LabelText("1号位触发")] [ToggleLeft]
        public bool pos1;

        [LabelText("2号位触发")] [ToggleLeft]
        public bool pos2;

         [LabelText("3号位触发")] [ToggleLeft]
        public bool pos3;

        [LabelText("4号位触发")] [ToggleLeft]
        public bool pos4;


        public bool Judge(int curPos) {
            return curPos switch {
                0 => pos1,
                1 => pos2,
                2 => pos3,
                3 => pos4,
                _ => false
            };
        }

        public override AINodeEntry NodeEntry() {
            return new PositionConditionEntry(this);
        }
    }


    public class PositionConditionEntry : ConditionEntry<PositionConditionNode> {
        public PositionConditionEntry(PositionConditionNode data) : base(data) { }

        public override bool Judge() {
            return true;
        }
    }
}